<?php self::header (); ?>

<div class="container">
	<div class="page-header">
		<h1>We're really sorry... <small>something bad has happened</small></h1>
	</div>
	<?php
	$quotes = array (
		array ("It's hard enough to find an error in your code when you're looking for it; it's even harder when you've assumed your code is error-free.",
		"Steve McConnell"),
		array ("If debugging is the process of removing software bugs, then programming must be the process of putting them in.",
		"Edsger Dijkstra"),
		array ("Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.",
		"Brian Kernighan"),
		array ("It's not at all important to get it right the first time. It's vitally important to get it right the last time.",
		"Andrew Hunt and David Thomas"),
		array ("There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code.",
		"Flon's Law"),
		array ("The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.",
		"Tom Cargill")
	);
	$quote = $quotes[array_rand ($quotes)];
	?>

	<?php
	switch ($data['error']) {
		case ERR_NEW_ACCOUNT_FAILED:
			$msg = "Something stopped us creating your new account.\nWe've logged the error so someone can look into it - in the meanwhile, you can safely go back and try again.";
			break;
		case ERR_NEW_ACCOUNT_LOGIN_FAILED:
			$msg = "We created your new account, but something stopped us logging you in.\nAll we can recommend is going to the login page and trying from there.";
			break;
		case ERR_READING_ACCOUNT:
			$msg = "We've currently having issues loading your account.\nThis is probably temporary - all we can recommend is logging out and back in.";
			break;
		case ERR_COOKIE_SESSION:
			$msg = "It appears your browser has cookies disabled, or some other security setting which is causing PassKey to fail.\nSorry, there's not much we can do except suggest you try another browser.";
			break;
		default:
			$msg = $data['error'];
	}
	?>
	<p class="lead"><?php self::eprint ($msg); ?></p>
	
	<blockquote class="pull-right text-right"><?php print $quote[0]; ?> <small><?php print $quote[1]; ?></small></blockquote>
</div>

<?php self::footer (); ?>